import request from '@/utils/request'

// 查询每日用电情况列表
export function listDayElecInfo(query) {
  return request({
    url: '/system/dayElecInfo/list',
    method: 'get',
    params: query
  })
}

// 查询每日用电情况详细
export function getDayElecInfo(userId) {
 
  return request({
    url: '/system/dayElecInfo/lastWeekElec',
    params: {
      userId: userId
    },
    method: 'get'
  })
}
// 查询每月用电情况详细
export function getMonthElecInfo(userId) {

  return request({
    url: '/system/dayElecInfo/lastMonthElec',
    params: {
      userId: userId
    },
    method: 'get'
  })
}

// 新增每日用电情况
export function addDayElecInfo(data) {
  return request({
    url: '/system/dayElecInfo',
    method: 'post',
    data: data
  })
}

// 修改每日用电情况
export function updateDayElecInfo(data) {
  return request({
    url: '/system/dayElecInfo',
    method: 'put',
    data: data
  })
}

// 删除每日用电情况
export function delDayElecInfo(userId) {
  return request({
    url: '/system/dayElecInfo/' + userId,
    method: 'delete'
  })
}
